.code
	ARBringWindowToFrontA proc lpClassName: DWORD
		local hWnd: DWORD

		call ResetError

		invoke lstrlenA, dword ptr ss:[ebp+8h] ; dword ptr ss:[ebp+8h] is equal to first parameter.
		cmp eax, 0h
		je @RET

		invoke FindWindowA, dword ptr ss:[ebp+8h], 0h
		mov hWnd, eax
		cmp eax, 0h
		je @RET

		invoke ShowWindow, hWnd, SW_RESTORE

		invoke SetForegroundWindow, hWnd
@RET:	ret
	ARBringWindowToFrontA endp

	ARBringWindowToFrontW proc lpClassName: DWORD
		local hWnd: DWORD

		call ResetError
		invoke lstrlenW, dword ptr ss:[ebp+8h]
		cmp eax, 0h
		je @RET

		invoke FindWindowW, dword ptr ss:[ebp+8h], 0h
		mov hWnd, eax
		cmp eax, 0h
		je @RET

		invoke ShowWindow, hWnd, SW_RESTORE
		invoke SetForegroundWindow, hWnd
@RET:	ret
	ARBringWindowToFrontW endp

	ARCloseInstance proc hInstance: DWORD
		call ResetError
		invoke ReleaseMutex, dword ptr ss:[ebp+8h]
		invoke CloseHandle, dword ptr ss:[ebp+8h]
		ret
	ARCloseInstance endp

	ARCommandLineA proc
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		call GetProcessHeap
		mov hHeap, eax

		call GetCommandLineA
		invoke lstrlenA, eax

		inc eax
		invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, eax
		mov dwBuffer, eax

		call GetCommandLineA
		invoke lstrcpyA, dwBuffer, eax

		mov edx, dwBuffer
		cmp byte ptr ds:[edx], 22h
		je @LOP2
@LOP1:
		inc edx
		cmp byte ptr ds:[edx], 0h
		je @OK
		cmp byte ptr ds:[edx], 20h
		je @OK
		jmp @LOP1
@LOP2:
		inc edx
		cmp byte ptr ds:[edx], 0h
		je @OK
		cmp byte ptr ds:[edx], 22h
		je @OK
		jmp @LOP2
@OK:
		inc edx
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h
		jne @F
		inc edx
@@:
		mov eax, edx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARCommandLineA endp

	ARCommandLineW proc
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		call GetProcessHeap
		mov hHeap, eax

		call GetCommandLineW
		invoke lstrlenW, eax

		mov ecx, 2h
		mul ecx
		add eax, 2h
		invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, eax
		mov dwBuffer, eax

		call GetCommandLineW
		invoke lstrcpyW, dwBuffer, eax

		mov edx, dwBuffer
		cmp byte ptr ds:[edx], 22h
		je @LOP2
@LOP1:
		add edx, 2h
		cmp byte ptr ds:[edx], 0h
		je @OK
		cmp byte ptr ds:[edx], 20h
		je @OK
		jmp @LOP1
@LOP2:
		add edx, 2h
		cmp byte ptr ds:[edx], 0h
		je @OK
		cmp byte ptr ds:[edx], 22h
		je @OK
		jmp @LOP2
@OK:
		add edx, 2h
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h
		jne @F
		add edx, 2h
@@:
		mov eax, edx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARCommandLineW endp

	ARCreateFileA proc lpFileName: DWORD
		call ResetError

		invoke lstrlenA, dword ptr ss:[ebp+8h]
		cmp eax, 0h
		je @RET

		invoke CreateFileA, dword ptr ss:[ebp+8h], FILE_APPEND_DATA, FILE_SHARE_WRITE, 0h, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0h
@RET:	ret
	ARCreateFileA endp

	ARCreateFileW proc lpFileName: DWORD
		call ResetError

		invoke lstrlenA, dword ptr ss:[ebp+8h]
		cmp eax, 0h
		je @RET

		invoke CreateFileW, dword ptr ss:[ebp+8h], FILE_APPEND_DATA, FILE_SHARE_WRITE, 0h, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0h
@RET:	ret
	ARCreateFileW endp

	ARCreateInstanceA proc lpMutexName: DWORD
		call ResetError

		invoke lstrlenA, dword ptr ss:[ebp+8h]
		cmp eax, 0h
		je @RET

		push dword ptr ss:[ebp+8h]
		push 1h
		push 0h
		call CreateMutexA
		mov g_hMutex, eax

		call GetLastError
		cmp eax, ERROR_ALREADY_EXISTS
		je @RET

		mov eax, g_hMutex
@RET:	ret
	ARCreateInstanceA endp

	ARCreateInstanceW proc lpMutexName: DWORD
		call ResetError

		invoke lstrlenW, dword ptr ss:[ebp+8h]
		cmp eax, 0h
		je @RET

		push dword ptr ss:[ebp+8h]
		push 1h
		push 0h
		call CreateMutexW
		mov g_hMutex, eax

		call GetLastError
		cmp eax, ERROR_ALREADY_EXISTS
		je @RET

		mov eax, g_hMutex
@RET:	ret
	ARCreateInstanceW endp

	ARDbgMsgA proc lpTextMessages: DWORD
		local nECX: DWORD
		local nEDX: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		cmp eax, 0h
		je @RET

		push MB_TOPMOST
		push offset g_szDebug
		push dword ptr ss:[ebp+8h]
		push 0h
		call MessageBoxA
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARDbgMsgA endp

	ARDbgMsgW proc lpTextMessages: DWORD
		local nECX: DWORD
		local nEDX: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		cmp eax, 0h
		je @RET

		push offset g_szDebug
		call ARStrAnsiToWide

		push MB_TOPMOST
		push eax
		push dword ptr ss:[ebp+8h]
		push 0h
		call MessageBoxW
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARDbgMsgW endp

	ARDeleteFileA proc lpFileName: DWORD
		local dwRet: DWORD
		local dwSize: DWORD
		local hFile: DWORD
		local hHeap: DWORD

		call ResetError

		push dword ptr ss:[ebp+8h]
		call ARFileExistsA
		cmp eax, 1h
		jne @RET

		push 0h
		push 0h
		push OPEN_EXISTING
		push 0h
		push FILE_SHARE_WRITE
		push GENERIC_WRITE
		push dword ptr ss:[ebp+8h]
		call CreateFileA

		mov hFile, eax
		cmp eax, INVALID_HANDLE_VALUE
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 0h
		push hFile
		call GetFileSize
		mov dwSize, eax

		push eax
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push 0h
		push dwSize
		push g_dwBuffer
		call RtlFillMemory

		push 0h
		lea eax, dwRet
		push eax
		push dwSize
		push g_dwBuffer
		push hFile
		call WriteFile
		push eax

		push g_dwBuffer
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapFree
		pop eax
		cmp eax, 1h
		jne @RET

		push hFile
		call CloseHandle

		push 0h
		push 0h
		push CREATE_ALWAYS
		push 0h
		push FILE_SHARE_WRITE
		push GENERIC_WRITE
		push dword ptr ss:[ebp+8h]
		call CreateFileA
		cmp eax, INVALID_HANDLE_VALUE
		je @RET

		push eax
		call CloseHandle

		push dword ptr ss:[ebp+8h]
		call DeleteFileA
		cmp eax, 0h
		je @RET

		xor eax, eax
		inc eax
@RET:	ret
	ARDeleteFileA endp

	ARDeleteFileW proc lpFileName: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwRet: DWORD
		local dwSize: DWORD
		local hFile: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call ARFileExistsW
		cmp eax, 1h
		jne @RET

		push 0h
		push 0h
		push OPEN_EXISTING
		push 0h
		push FILE_SHARE_WRITE
		push GENERIC_WRITE
		push dword ptr ss:[ebp+8h]
		call CreateFileW

		mov hFile, eax
		cmp eax, INVALID_HANDLE_VALUE
		je @RET

		push 0h
		push hFile
		call GetFileSize

		mov ecx, 2h
		mul ecx
		mov dwSize, eax

		call GetProcessHeap
		mov hHeap, eax

		push dwSize
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push 0h
		push dwSize
		push g_dwBuffer
		call RtlFillMemory

		push 0h
		lea eax, dwRet
		push eax
		push dwSize
		push g_dwBuffer
		push hFile
		call WriteFile
		push eax

		push g_dwBuffer
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapFree
		pop eax
		cmp eax, 1h
		jne @RET

		push hFile
		call CloseHandle

		push 0h
		push 0h
		push CREATE_ALWAYS
		push 0h
		push FILE_SHARE_WRITE
		push GENERIC_WRITE
		push dword ptr ss:[ebp+8h]
		call CreateFileW
		cmp eax, INVALID_HANDLE_VALUE
		je @RET

		push eax
		call CloseHandle

		push dword ptr ss:[ebp+8h]
		call DeleteFileW
		cmp eax, 0h
		je @RET

		xor eax, eax
		inc eax
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARDeleteFileW endp

	ARFileExistsA proc lpFileName: DWORD
		local nEDX: DWORD
		local lpFindFileData: WIN32_FIND_DATAA

		mov nEDX, edx
		call ResetError

		lea eax, lpFindFileData
		push eax
		push dword ptr ss:[ebp+8h]
		call FindFirstFileA

		mov edx, eax
		xor eax, eax
		cmp edx, INVALID_HANDLE_VALUE
		je @RET
		mov eax, 2h
		cmp lpFindFileData.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY
		je @RET
		mov eax, lpFindFileData.dwFileAttributes
		and eax, FILE_ATTRIBUTE_DIRECTORY
		cmp eax, FILE_ATTRIBUTE_DIRECTORY
		je @RET
		mov eax, 1h
@RET:	mov edx, nEDX
		ret
	ARFileExistsA endp

	ARFileExistsW proc lpFileName: DWORD
		local nEDX: DWORD
		local lpFindFileData: WIN32_FIND_DATAW

		mov nEDX, edx
		call ResetError

		lea eax, lpFindFileData
		push eax
		push dword ptr ss:[ebp+8h]
		call FindFirstFileW

		mov edx, eax
		xor eax, eax
		cmp edx, INVALID_HANDLE_VALUE
		je @RET
		mov eax, 2h
		cmp lpFindFileData.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY
		je @RET
		mov eax, lpFindFileData.dwFileAttributes
		and eax, FILE_ATTRIBUTE_DIRECTORY
		cmp eax, FILE_ATTRIBUTE_DIRECTORY
		je @RET
		mov eax, 1h
@RET:	mov edx, nEDX
		ret
	ARFileExistsW endp

	ARFindStringA proc lpText: DWORD, lpTextToFind: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwEDI: DWORD
		local dwESI: DWORD
		local dwTSize: DWORD
		local dwTTFSize: DWORD

		mov nECX, ecx
		mov nEDX, edx
		mov dwEDI, edi
		mov dwESI, esi
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwTSize, eax
		cmp eax, 0h
		je @RET

		push dword ptr ss:[ebp+0Ch]
		call lstrlenA
		mov dwTTFSize, eax
		cmp eax, 0h
		je @RET
		xor edi, edi
@LOP1:
		xor ecx, ecx
		xor esi, esi
@LOP:
		mov eax, dword ptr ss:[ebp+8h]
		mov edx, dword ptr ss:[ebp+0Ch]
		mov ah, byte ptr ds:[eax+edi]
		mov al, byte ptr ds:[edx+esi]
		cmp edi, dwTSize
		je @ERR
		cmp ah, al
		je @F
		inc edi
		jmp @LOP
@@:
		inc ecx
		inc edi
		inc esi
		mov eax, dword ptr ss:[ebp+8h]
		mov edx, dword ptr ss:[ebp+0Ch]
		mov ah, byte ptr ds:[eax+edi]
		mov al, byte ptr ds:[edx+esi]
		cmp ecx, dwTTFSize
		je @F
		cmp ah, al
		jne @LOP1
		jmp @B
@ERR:
		mov eax, 0FFFFFFFFh
		jmp @RET
@@:
		mov eax, edi
		sub eax, ecx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		mov edi, dwEDI
		mov esi, dwESI
		ret
	ARFindStringA endp

	ARFindStringW proc lpText: DWORD, lpTextToFind: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwEDI: DWORD
		local dwESI: DWORD
		local dwTSize: DWORD
		local dwTTFSize: DWORD

		mov nECX, ecx
		mov nEDX, edx
		mov dwEDI, edi
		mov dwESI, esi
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		mov ecx, 2h
		mul ecx
		mov dwTSize, eax
		cmp eax, 0h
		je @RET

		push dword ptr ss:[ebp+0Ch]
		call lstrlenW
		mov ecx, 2h
		mul ecx
		mov dwTTFSize, eax
		cmp eax, 0h
		je @RET
		xor edi, edi
@LOP1:
		xor ecx, ecx
		xor esi, esi
@LOP:
		mov eax, dword ptr ss:[ebp+8h]
		mov edx, dword ptr ss:[ebp+0Ch]
		mov ah, byte ptr ds:[eax+edi]
		mov al, byte ptr ds:[edx+esi]
		cmp edi, dwTSize
		je @ERR
		cmp ah, al
		je @F
		add edi, 2h
		jmp @LOP
@@:
		add ecx, 2h
		add edi, 2h
		add esi, 2h
		mov eax, dword ptr ss:[ebp+8h]
		mov edx, dword ptr ss:[ebp+0Ch]
		mov ah, byte ptr ds:[eax+edi]
		mov al, byte ptr ds:[edx+esi]
		cmp ecx, dwTTFSize
		je @F
		cmp ah, al
		jne @LOP1
		jmp @B
@ERR:
		mov eax, 0FFFFFFFFh
		jmp @RET
@@:
		mov eax, edi
		sub eax, ecx
		mov ecx, 2h
		xor edx, edx
		div ecx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		mov edi, dwEDI
		mov esi, dwESI
		ret
	ARFindStringW endp

	ARGetArgvString proc lpText: DWORD, dwIndex: DWORD ; Not finished yet
		local dwLength: DWORD

		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		

@RET:	ret
	ARGetArgvString endp

	ARGetCharA proc bChar: BYTE
		local nEDX: DWORD
		local dwBuffer: DWORD

		mov nEDX, edx
		xor edx, edx
		mov dl, byte ptr ss:[ebp+8h]
		lea eax, dwBuffer
		mov byte ptr ds:[eax], dl
		mov byte ptr ds:[eax+1], 0h
		mov edx, nEDX
		ret
	ARGetCharA endp

	ARGetCharW proc bChar: BYTE
		local nEDX: DWORD
		local dwBuffer: DWORD

		mov nEDX, edx
		xor edx, edx
		mov dl, byte ptr ss:[ebp+8h]
		lea eax, dwBuffer
		mov byte ptr ds:[eax], dl
		mov byte ptr ds:[eax+1], 0h
		mov word ptr ds:[eax+2], 0h
		mov edx, nEDX
		ret
	ARGetCharW endp

	ARGetErrorMessageA proc dwErrNumber: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		xor ecx, ecx
		xor edx, edx
		call ResetError

		call GetProcessHeap
		mov hHeap, eax

		push 260
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push 0h
		push 260
		push g_dwBuffer
		push 0h
		push dword ptr ss:[ebp+8h]
		push 0h
		push FORMAT_MESSAGE_FROM_SYSTEM
		call FormatMessageA

		mov ecx, nECX
		mov edx, nEDX
		mov eax, g_dwBuffer
		ret
	ARGetErrorMessageA endp

	ARGetErrorMessageW proc dwErrNumber: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		call GetProcessHeap
		mov hHeap, eax

		push 512
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push 0h
		push 512
		push g_dwBuffer
		push 0h
		push dword ptr ss:[ebp+8h]
		push 0h
		push FORMAT_MESSAGE_FROM_SYSTEM
		call FormatMessageW

		mov ecx, nECX
		mov edx, nEDX
		mov eax, g_dwBuffer
		ret
	ARGetErrorMessageW endp

	ARGetFileSizeByHandleA proc hModule: DWORD
		local dwSize: DWORD
		local hFile: DWORD
		local hHeap: DWORD

		call ResetError

		mov eax, 0FFFFFFFFh
		cmp dword ptr ss:[ebp+8h], 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 260
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc

		push 260
		push g_dwBuffer
		push dword ptr ss:[ebp+8h]
		call GetModuleFileNameA

		push 0h
		push 0h
		push OPEN_EXISTING
		push 0h
		push FILE_SHARE_READ
		push GENERIC_READ
		lea eax, g_dwBuffer
		push eax
		call CreateFileA
		mov hFile, eax
		cmp eax, INVALID_HANDLE_VALUE
		je @RET_ERR

		push 0h
		push hFile
		call GetFileSize
		mov dwSize, eax

		push hFile
		call CloseHandle
@RET_ERR:
		push 260
		push g_dwBuffer
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapFree
		mov eax, dwSize
@RET:	ret
	ARGetFileSizeByHandleA endp

	ARGetFileSizeByHandleW proc hModule: DWORD
		local dwSize: DWORD
		local hFile: DWORD
		local hHeap: DWORD

		call ResetError

		mov eax, 0FFFFFFFFh
		cmp dword ptr ss:[ebp+8h], 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 512
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push 512
		push g_dwBuffer
		push dword ptr ss:[ebp+8h]
		call GetModuleFileNameW

		push 0h
		push 0h
		push OPEN_EXISTING
		push 0h
		push FILE_SHARE_READ
		push GENERIC_READ
		push g_dwBuffer
		call CreateFileW
		mov hFile, eax
		cmp eax, INVALID_HANDLE_VALUE
		je @RET_ERR

		push 0h
		push hFile
		call GetFileSize
		mov dwSize, eax

		push hFile
		call CloseHandle
@RET_ERR:
		push 512
		push g_dwBuffer
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapFree
		mov eax, dwSize
@RET:	ret
	ARGetFileSizeByHandleW endp

	ARGetINIFileStringA proc lpFileName: DWORD, lpAppName: DWORD, lpKeyName: DWORD
		local hHeap: DWORD

		call ResetError

		push dword ptr ss:[ebp+8h]
		call ARFileExistsA
		cmp eax, 1h
		jne @RET

		call GetProcessHeap
		mov hHeap, eax

		push 255
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push 255
		push g_dwBuffer
		push 0h
		push dword ptr ss:[ebp+10h]
		push dword ptr ss:[ebp+0Ch]
		call GetPrivateProfileStringA
		mov eax, g_dwBuffer
@RET:
		ret
	ARGetINIFileStringA endp

	ARGetINIFileStringW proc lpFileName: DWORD, lpAppName: DWORD, lpKeyName: DWORD
		local hHeap: DWORD

		call ResetError

		push dword ptr ss:[ebp+8h]
		call ARFileExistsW
		cmp eax, 1h
		jne @RET

		call GetProcessHeap
		mov hHeap, eax

		push 512
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push 512
		push g_dwBuffer
		push 0h
		push dword ptr ss:[ebp+10h]
		push dword ptr ss:[ebp+0Ch]
		call GetPrivateProfileStringW
		mov eax, g_dwBuffer
@RET:
		ret
	ARGetINIFileStringW endp

	ARGetParentFolderNameA proc lpFileName: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 260
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push g_dwBuffer
		call lstrcpyA
		mov eax, g_dwBuffer
		mov ecx, dwLength
@@:
		cmp byte ptr ds:[eax+ecx], 5Ch ; 5Ch equal to char '\'
		je @RET
		mov byte ptr ds:[eax+ecx], 0h
		dec ecx
		cmp ecx, 0h
		je @FAIL
		jmp @B
@FAIL:
		xor eax, eax
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARGetParentFolderNameA endp

	ARGetParentFolderNameW proc lpFileName: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		cmp eax, 0h
		je @RET

		mov ecx, 2h
		mul ecx
		mov dwLength, eax

		call GetProcessHeap
		mov hHeap, eax

		push 512
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push g_dwBuffer
		call lstrcpyW
		mov eax, g_dwBuffer
		mov ecx, dwLength
@@:
		cmp byte ptr ds:[eax+ecx], 5Ch ; Equal to char '\'
		je @RET
		mov byte ptr ds:[eax+ecx], 0h
		sub ecx, 2h
		cmp ecx, 0h
		je @FAIL
		jmp @B
@FAIL:
		xor eax, eax
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARGetParentFolderNameW endp

	ARInitCommonControlsEx proc bInit: BYTE
		local lpICCX: INITCOMMONCONTROLSEX

		call ResetError

		xor eax, eax
		cmp byte ptr ss:[ebp+8h], 1h
		jne @F
		mov lpICCX.dwSize, sizeof INITCOMMONCONTROLSEX
		mov lpICCX.dwICC, ICC_WIN95_CLASSES
		lea eax, lpICCX
		push eax
		call InitCommonControlsEx
@@:
		ret
	ARInitCommonControlsEx endp

	ARInitConsole proc bInit: BYTE
		call ResetError

		xor eax, eax
		cmp byte ptr ss:[ebp+8h], 1h
		jne @F
		call AllocConsole
@@:		ret
	ARInitConsole endp

	ARInitSystemShutdown proc bInit: BYTE
		call ResetError

		push offset SHUTDOWN_NAME
		call ARStrAnsiToWide

		push dword ptr ss:[ebp+8h]
		push eax
		call ARSetTokenPrivilegesW
		ret
	ARInitSystemShutdown endp

	ARInitSystemTime proc bInit: BYTE
		call ResetError

		push offset SYSTEMTIME_NAME
		call ARStrAnsiToWide

		push dword ptr ss:[ebp+8h]
		push eax
		call ARSetTokenPrivilegesW
		ret
	ARInitSystemTime endp

	ARInitWinsock proc bInit: BYTE, lpWSAData: DWORD
		call ResetError

		xor eax, eax
		cmp byte ptr ss:[ebp+8h], 1h
		jne @F
		push dword ptr ss:[ebp+0Ch]
		push 202h
		call WSAStartup
@@:		ret
	ARInitWinsock endp

	ARIntegerToString proc dwNumber: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwESI: DWORD
		local dwEDI: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		mov dwESI, esi
		mov dwEDI, edi
		call ResetError

		call GetProcessHeap
		mov hHeap, eax

		push 260
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		xor ecx, ecx
		mov eax, dword ptr ss:[ebp+8h]
		mov esi, 1000000000
@LOP:
		cmp ecx, 0h
		jne @F
		mov eax, dword ptr ss:[ebp+8h]
@@:
		xor edx, edx
		div esi
		cmp eax, 0h
		je @F
		mov edi, g_dwBuffer
		add al, 30h
		mov byte ptr ds:[edi+ecx], al
		mov byte ptr ds:[edi+ecx+1], 0h
		inc ecx
		jmp @DEC
@@:
		cmp ecx, 0h
		je @DEC
		mov edi, g_dwBuffer
		add al, 30h
		mov byte ptr ds:[edi+ecx], al
		mov byte ptr ds:[edi+ecx+1], 0h
		inc ecx
@DEC:
		mov eax, edx
		xor edx, edx
		push eax
		mov eax, esi
		mov edi, 10
		div edi
		mov esi, eax
		pop eax
		cmp esi, 0h
		jne @LOP
		mov ecx, nECX
		mov edx, nEDX
		mov esi, dwESI
		mov edi, dwEDI
		mov eax, g_dwBuffer
		ret
	ARIntegerToString endp

	ARIs64bitOS proc
		local dwReturn: DWORD

		call ResetError

		push offset g_szLibKernel32
		call LoadLibraryA
		cmp eax, 0h
		je @RET

		push offset g_szfnIsWow64Process
		push eax
		call GetProcAddress
		cmp eax, 0h
		je @RET

		mov g_fnIsWow64Process, eax

		lea eax, dwReturn
		push eax
		call GetCurrentProcess
		push eax
		call g_fnIsWow64Process
		cmp eax, 0h
		je @RET

		mov eax, dwReturn
@RET:	ret
	ARIs64bitOS endp

	ARMakeDword proc wHiWord: WORD, wLowWord: WORD
		xor eax, eax
		mov ax, word ptr ss:[ebp+8h]
		rol eax, 10h
		mov ax, word ptr ss:[ebp+0Ch]
		ret
	ARMakeDword endp

	ARMakeWord proc bHiByte: BYTE, bLowByte: BYTE
		xor eax, eax
		mov ah, byte ptr ss:[ebp+8h]
		mov al, byte ptr ss:[ebp+0Ch]
		ret
	ARMakeWord endp

	ARReadConsole proc
		local dwBuffer: DWORD
		call ResetError

		push 255
		push GPTR
		call GlobalAlloc
		mov dwBuffer, eax

		push STD_INPUT_HANDLE
		call GetStdHandle
		mov g_hStdInput, eax

		push 0h
		lea eax, g_dwReturn
		push eax
		push 255
		push dwBuffer
		push g_hStdInput
		call ReadFile

		mov eax, dwBuffer
		ret
	ARReadConsole endp

	ARRebootSystem proc bForce: BYTE
		call ResetError

		mov eax, EWX_REBOOT
		cmp byte ptr ss:[ebp+8h], 1h
		jne @F
		add eax, EWX_FORCE
@@:
		push 0h
		push eax
		call ExitWindowsEx
		ret
	ARRebootSystem endp

	ARSetDCFontA proc hDC: DWORD, lpFontName: DWORD, dwSize: DWORD
		local hDC1: DWORD
		local hFont: DWORD

		call ResetError

		push 0h
		call GetDC
		mov hDC1, eax

		push LOGPIXELSY
		push eax
		call GetDeviceCaps

		push 72
		push eax
		push dword ptr ss:[ebp+10h]
		call MulDiv

		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push eax
		call CreateFontA
		mov hFont, eax

		push hDC1
		push 0h
		call ReleaseDC

		push hFont
		push dword ptr ss:[ebp+8h]
		call SelectObject
		xor eax, eax
		inc eax
		ret
	ARSetDCFontA endp

	ARSetDCFontW proc hDC: DWORD, lpFontName: DWORD, dwSize: DWORD
		local hDC1: DWORD
		local hFont: DWORD

		call ResetError

		push 0h
		call GetDC
		mov hDC1, eax

		push LOGPIXELSY
		push eax
		call GetDeviceCaps

		push 72
		push eax
		push dword ptr ss:[ebp+10h]
		call MulDiv

		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push eax
		call CreateFontW
		mov hFont, eax

		push hDC1
		push 0h
		call ReleaseDC

		push hFont
		push dword ptr ss:[ebp+8h]
		call SelectObject
		xor eax, eax
		inc eax
		ret
	ARSetDCFontW endp

	ARSetDCTextA proc hDC: DWORD, lpText: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		call lstrlenA

		push eax
		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push dword ptr ss:[ebp+8h]
		call TextOutA
		ret
	ARSetDCTextA endp

	ARSetDCTextW proc hDC: DWORD, lpText: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		call lstrlenW

		push eax
		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push dword ptr ss:[ebp+8h]
		call TextOutW
		ret
	ARSetDCTextW endp

	ARSetDefDCFont proc hDC: DWORD
		call ResetError

		push DEFAULT_GUI_FONT
		call GetStockObject

		push eax
		push dword ptr ss:[ebp+8h]
		call SelectObject
		ret
	ARSetDefDCFont endp

	ARSetDefWindowFontA proc hWnd: DWORD
		call ResetError

		xor eax, eax
		cmp dword ptr ss:[ebp+8h], 0h
		je @RET

		push DEFAULT_GUI_FONT
		call GetStockObject
		push 0h
		push eax
		push WM_SETFONT
		push dword ptr ss:[ebp+8h]
		call SendMessageA
@RET:	ret
	ARSetDefWindowFontA endp

	ARSetDefWindowFontW proc hWnd: DWORD
		call ResetError

		xor eax, eax
		cmp dword ptr ss:[ebp+8h], 0h
		je @RET

		push DEFAULT_GUI_FONT
		call GetStockObject
		push 0h
		push eax
		push WM_SETFONT
		push dword ptr ss:[ebp+8h]
		call SendMessageW
@RET:	ret
	ARSetDefWindowFontW endp

	ARSetDlgProcA proc hWnd: DWORD, lpProcName: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		push GWL_WNDPROC
		push dword ptr ss:[ebp+8h]
		call SetWindowLongA
		ret
	ARSetDlgProcA endp

	ARSetDlgProcW proc hWnd: DWORD, lpProcName: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		push GWL_WNDPROC
		push dword ptr ss:[ebp+8h]
		call SetWindowLongW
		ret
	ARSetDlgProcW endp

	ARSetTokenPrivilegesA proc lpPrivilegeName: DWORD, bEnable: BYTE
		local hToken: DWORD
		local lpTokenPrivileges: TOKEN_PRIVILEGES

		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		cmp eax, 0h
		je @RET

		lea eax, hToken
		push eax
		mov eax, TOKEN_ADJUST_PRIVILEGES
		add eax, TOKEN_QUERY
		push eax
		call GetCurrentProcess
		push eax
		call OpenProcessToken

		lea eax, lpTokenPrivileges.Privileges[0].Luid
		push eax
		push dword ptr ss:[ebp+8h]
		push 0h
		call LookupPrivilegeValueA

		movzx eax, byte ptr ss:[ebp+0Ch]
		mov lpTokenPrivileges.PrivilegeCount, eax
		mov lpTokenPrivileges.Privileges[0].Attributes, SE_PRIVILEGE_ENABLED

		lea eax, g_dwReturn
		push eax
		push 0h
		push sizeof TOKEN_PRIVILEGES
		lea eax, lpTokenPrivileges
		push eax
		push 0h
		push hToken
		call AdjustTokenPrivileges
@RET:	ret
	ARSetTokenPrivilegesA endp

	ARSetTokenPrivilegesW proc lpPrivilegeName: DWORD, bEnable: BYTE
		local hToken: DWORD
		local lpTokenPrivileges: TOKEN_PRIVILEGES

		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		cmp eax, 0h
		je @RET

		lea eax, hToken
		push eax
		mov eax, TOKEN_ADJUST_PRIVILEGES
		add eax, TOKEN_QUERY
		push eax
		call GetCurrentProcess
		push eax
		call OpenProcessToken

		lea eax, lpTokenPrivileges.Privileges[0].Luid
		push eax
		push dword ptr ss:[ebp+8h]
		push 0h
		call LookupPrivilegeValueW

		movzx eax, byte ptr ss:[ebp+0Ch]
		mov lpTokenPrivileges.PrivilegeCount, eax
		mov lpTokenPrivileges.Privileges[0].Attributes, SE_PRIVILEGE_ENABLED

		lea eax, g_dwReturn
		push eax
		push 0h
		push sizeof TOKEN_PRIVILEGES
		lea eax, lpTokenPrivileges
		push eax
		push 0h
		push hToken
		call AdjustTokenPrivileges
@RET:	ret
	ARSetTokenPrivilegesW endp

	ARSetWindowCenterScreen proc hWnd: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local nPosX: DWORD
		local nPosY: DWORD
		local lpRECT: RECT

		call ResetError

		mov nECX, ecx
		mov nEDX, edx
		xor eax, eax
		cmp dword ptr ss:[ebp+8h], 0h
		je @RET

		lea eax, lpRECT
		push eax
		push dword ptr ss:[ebp+8h]
		call GetWindowRect

		mov eax, lpRECT.right
		sub eax, lpRECT.left
		push eax
		push SM_CXSCREEN
		call GetSystemMetrics
		pop ecx
		sub eax, ecx
		mov ecx, 2h
		xor edx, edx
		div ecx
		mov nPosX, eax

		mov eax, lpRECT.bottom
		sub eax, lpRECT.top
		push eax
		push SM_CYSCREEN
		call GetSystemMetrics
		pop ecx
		sub eax, ecx
		mov ecx, 2h
		xor edx, edx
		div ecx
		mov nPosY, eax

		push SWP_NOSIZE
		push 0h
		push 0h
		push nPosY
		push nPosX
		push 0h
		push dword ptr ss:[ebp+8h]
		call SetWindowPos
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARSetWindowCenterScreen endp

	ARSetWindowExStyle proc hWnd: DWORD, dwExStyle: DWORD
		call ResetError

		push GWL_EXSTYLE
		push dword ptr ss:[ebp+8h]
		call GetWindowLong

		mov ecx, dword ptr ss:[ebp+0Ch]
		add eax, ecx
		push eax
		push GWL_EXSTYLE
		push dword ptr ss:[ebp+8h]
		call SetWindowLong
		ret
	ARSetWindowExStyle endp

	ARSetWindowFontA proc hWnd: DWORD, lpFontName: DWORD, dwSize: DWORD
		local hDC: DWORD

		call ResetError

		push 0h
		call GetDC
		mov hDC, eax

		push LOGPIXELSY
		push hDC
		call GetDeviceCaps

		push 72
		push eax
		push dword ptr ss:[ebp+10h]
		call MulDiv

		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push eax
		call CreateFontA

		push 0h
		push eax
		push WM_SETFONT
		push dword ptr ss:[ebp+8h]
		call SendMessageA
		push eax

		; Don't use DeleteObject, all commit will be destroyed.

		push hDC
		push dword ptr ss:[ebp+8h]
		call ReleaseDC

		pop eax
		ret
	ARSetWindowFontA endp

	ARSetWindowFontW proc hWnd: DWORD, lpFontName: DWORD, dwSize: DWORD
		local hDC: DWORD

		call ResetError

		push 0h
		call GetDC
		mov hDC, eax

		push LOGPIXELSY
		push hDC
		call GetDeviceCaps

		push 72
		push eax
		push dword ptr ss:[ebp+10h]
		call MulDiv

		push dword ptr ss:[ebp+0Ch]
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push 0h
		push eax
		call CreateFontW

		push 0h
		push eax
		push WM_SETFONT
		push dword ptr ss:[ebp+8h]
		call SendMessageW
		push eax

		; Don't use DeleteObject, all commit will be destroyed.

		push hDC
		push dword ptr ss:[ebp+8h]
		call ReleaseDC

		pop eax
		ret
	ARSetWindowFontW endp

	ARSetWindowOpacity proc hWnd: DWORD, bOpacity: BYTE
		call ResetError

		push GWL_EXSTYLE
		push dword ptr ss:[ebp+8h]
		call GetWindowLongA
		; Don't use comparison return value. Due we need the value of return value.

		add eax, WS_EX_LAYERED
		push eax
		push GWL_EXSTYLE
		push dword ptr ss:[ebp+8h]
		call SetWindowLongA
		; Don't use comparison return value. Due we need the value of return value.

		push LWA_ALPHA
		movzx eax, byte ptr ss:[ebp+0Ch]
		push eax
		push 0h
		push dword ptr ss:[ebp+8h]
		call SetLayeredWindowAttributes
@RET:
		ret
	ARSetWindowOpacity endp

	ARSetWindowTextA proc hWnd: DWORD, lpText: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		call lstrlenA

		push dword ptr ss:[ebp+0Ch]
		push eax
		push WM_SETTEXT
		push dword ptr ss:[ebp+8h]
		call SendMessageA
		ret
	ARSetWindowTextA endp

	ARSetWindowTextW proc hWnd: DWORD, lpText: DWORD
		call ResetError

		push dword ptr ss:[ebp+0Ch]
		call lstrlenW

		push dword ptr ss:[ebp+0Ch]
		push eax
		push WM_SETTEXT
		push dword ptr ss:[ebp+8h]
		call SendMessageW
		ret
	ARSetWindowTextW endp

	ARSetWindowTopMost proc hWnd: DWORD, bTopMost: BYTE
		call ResetError

		mov eax, SWP_NOSIZE
		add eax, SWP_NOMOVE
		push eax
		push 0h
		push 0h
		push 0h
		push 0h
		movzx eax, byte ptr ss:[ebp+0Ch]
		sub eax, 2h
		push eax
		push dword ptr ss:[ebp+8h]
		call SetWindowPos
		ret
	ARSetWindowTopMost endp

	ARShellExecuteWaitA proc lpFileName: DWORD, lpParameters: DWORD, nCmdShow: DWORD
		local lpSEH: SHELLEXECUTEINFOA

		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		cmp eax, 0h
		je @RET

		mov lpSEH.cbSize, sizeof SHELLEXECUTEINFOA
		mov lpSEH.fMask, SEE_MASK_NOCLOSEPROCESS
		mov lpSEH.hwnd, 0h
		mov lpSEH.lpVerb, 0h
		mov eax, dword ptr ss:[ebp+8h]
		mov lpSEH.lpFile, eax
		mov eax, dword ptr ss:[ebp+0Ch]
		mov lpSEH.lpParameters, eax
		mov lpSEH.lpDirectory, 0h
		mov eax, dword ptr ss:[ebp+10h]
		mov lpSEH.nShow, eax

		lea eax, lpSEH
		push eax
		call ShellExecuteExA
		cmp eax, 0h
		je @RET

		push 0FFFFFFFFh
		push lpSEH.hProcess
		call WaitForSingleObject
		xor eax, eax
		inc eax
@RET:
		ret
	ARShellExecuteWaitA endp

	ARShellExecuteWaitW proc lpFileName: DWORD, lpParameters: DWORD, nCmdShow: DWORD
		local lpSEH: SHELLEXECUTEINFOW

		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		cmp eax, 0h
		je @RET

		mov lpSEH.cbSize, sizeof SHELLEXECUTEINFOW
		mov lpSEH.fMask, SEE_MASK_NOCLOSEPROCESS
		mov lpSEH.hwnd, 0h
		mov lpSEH.lpVerb, 0h
		mov eax, dword ptr ss:[ebp+8h]
		mov lpSEH.lpFile, eax
		mov eax, dword ptr ss:[ebp+0Ch]
		mov lpSEH.lpParameters, eax
		mov lpSEH.lpDirectory, 0h
		mov eax, dword ptr ss:[ebp+10h]
		mov lpSEH.nShow, eax

		lea eax, lpSEH
		push eax
		call ShellExecuteExW
		cmp eax, 0h
		je @RET

		push 0FFFFFFFFh
		push lpSEH.hProcess
		call WaitForSingleObject
		xor eax, eax
		inc eax
@RET:
		ret
	ARShellExecuteWaitW endp

	ARShutdownSystem proc bForce: BYTE
		call ResetError

		mov eax, EWX_SHUTDOWN
		cmp byte ptr ss:[ebp+8h], 1h
		jne @F
		add eax, EWX_FORCE
@@:
		push 0h
		push eax
		call ExitWindowsEx
		ret
	ARShutdownSystem endp

	ARStrAnsiToWide proc lpAnsiText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 260
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		xor ecx, ecx
		xor edx, edx
		mov eax, g_dwBuffer
@LOP:
		mov edx, dword ptr ss:[ebp+8h]
		mov dl, byte ptr ds:[edx+ecx]
		mov byte ptr ds:[eax], dl
		mov byte ptr ds:[eax+1], 0h
		add eax, 2h
		cmp dwLength, ecx
		je @OK
		inc ecx
		jmp @LOP
@OK:	mov eax, g_dwBuffer
@RET:	mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrAnsiToWide endp

	ARStrFindA proc lpAnsiText: DWORD, lpTextToFind: DWORD ; Not finished yet
		ret
	ARStrFindA endp

	ARStrFindW proc lpWideText: DWORD, lpTextToFind: DWORD ; Not finished yet
		ret
	ARStrFindW endp

	ARStrIsIntegerA proc lpAnsiText: DWORD ; Not finished yet
		ret
	ARStrIsIntegerA endp

	ARStrIsIntegerW proc lpWideText: DWORD ; Not finished yet
		ret
	ARStrIsIntegerW endp

	ARStrLowerA proc lpAnsiText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push dwLength
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push dwBuffer
		call lstrcpyA

		xor ecx, ecx
		mov eax, dwBuffer
		jmp @NEXT
@LOP0:
		cmp byte ptr ds:[eax+ecx], 0h
		je @RET
		inc ecx
@NEXT:
		cmp byte ptr ds:[eax+ecx], 41h ; 61h equal to 'A'
		jnge @LOP0

		cmp byte ptr ds:[eax+ecx], 5Ah ; 7Ah equal to 'Z'
		jnle @LOP0

		add byte ptr ds:[eax+ecx], 20h ; 20h equal to ' ' (space)
		jmp @LOP0
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrLowerA endp

	ARStrLowerW proc lpWideText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		mov eax, dwLength
		mov ecx, 2h
		mul ecx
		push eax
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push dwBuffer
		call lstrcpyW

		xor ecx, ecx
		mov eax, dwBuffer
		jmp @NEXT
@LOP0:
		cmp byte ptr ds:[eax+ecx], 0h
		je @RET
		add ecx, 2h
@NEXT:
		cmp byte ptr ds:[eax+ecx], 41h ; 61h equal to 'A'
		jnge @LOP0

		cmp byte ptr ds:[eax+ecx], 5Ah ; 7Ah equal to 'Z'
		jnle @LOP0

		add byte ptr ds:[eax+ecx], 20h
		jmp @LOP0
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrLowerW endp

	ARStrReplaceA proc lpAnsiText: DWORD, lpTextToFind: DWORD, lpTextToReplace: DWORD ; Not finished yet
		ret
	ARStrReplaceA endp

	ARStrReplaceW proc lpWideText: DWORD, lpTextToFind: DWORD, lpTextToReplace: DWORD ; Not finished yet
		ret
	ARStrReplaceW endp

	ARStrTrimA proc lpAnsiText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwFirstPos: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		cmp eax, 0h
		je @RET
		mov edx, dword ptr ss:[ebp+8h]
@LOP:
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h
		je @F
		jmp @NEXT
@@:
		mov byte ptr ds:[edx], 0h
		inc edx
		jmp @LOP
@NEXT:
		mov dwFirstPos, edx
		push edx
		call lstrlenA
		mov edx, dwFirstPos
		add edx, eax
@LOP2:
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h
		je @F
		jmp @NEXT2
@@:
		mov byte ptr ds:[edx], 0h
		dec edx
		jmp @LOP2
@NEXT2:
		mov edx, dwFirstPos
		mov eax, edx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrTrimA endp

	ARStrTrimW proc lpWideText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwFirstPos: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		cmp eax, 0h
		je @RET
		mov edx, dword ptr ss:[ebp+8h]
@LOP:
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h ; 20h equal to ' ' (space)
		je @F
		jmp @NEXT
@@:
		mov byte ptr ds:[edx], 0h
		add edx, 2h
		jmp @LOP
@NEXT:
		mov dwFirstPos, edx
		push edx
		call lstrlenW
		mov ecx, 2h
		mul ecx
		mov edx, dwFirstPos
		add edx, eax
@LOP2:
		cmp byte ptr ds:[edx], 0h
		je @F
		cmp byte ptr ds:[edx], 20h ; 20h equal to ' ' (space)
		je @F
		jmp @NEXT2
@@:
		mov byte ptr ds:[edx], 0h
		sub edx, 2h
		jmp @LOP2
@NEXT2:
		mov edx, dwFirstPos
		mov eax, edx
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrTrimW endp

	ARStrUpperA proc lpAnsiText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push dwLength
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push dwBuffer
		call lstrcpyA

		xor ecx, ecx
		mov eax, dwBuffer
		jmp @NEXT
@LOP0:
		cmp byte ptr ds:[eax+ecx], 0h
		je @RET
		inc ecx
@NEXT:
		cmp byte ptr ds:[eax+ecx], 61h ; 61h equal to 'a'
		jnge @LOP0

		cmp byte ptr ds:[eax+ecx], 7Ah ; 7Ah equal to 'z'
		jnle @LOP0

		sub byte ptr ds:[eax+ecx], 20h
		jmp @LOP0
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrUpperA endp

	ARStrUpperW proc lpWideText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwBuffer: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		mov eax, dwLength
		mov ecx, 2h
		mul ecx
		push eax
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov dwBuffer, eax

		push dword ptr ss:[ebp+8h]
		push dwBuffer
		call lstrcpyW

		xor ecx, ecx
		mov eax, dwBuffer
		jmp @NEXT
@LOP0:
		cmp byte ptr ds:[eax+ecx], 0h
		je @RET
		add ecx, 2h
@NEXT:
		cmp byte ptr ds:[eax+ecx], 61h ; 61h equal to 'a'
		jnge @LOP0

		cmp byte ptr ds:[eax+ecx], 7Ah ; 7Ah equal to 'z'
		jnle @LOP0

		sub byte ptr ds:[eax+ecx], 20h
		jmp @LOP0
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrUpperW endp

	ARStrWideToAnsi proc lpWideText: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenW
		mov ecx, 2h
		mul ecx
		mov dwLength, eax
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push 512
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		xor ecx, ecx
@LOP:
		mov edx, dword ptr ss:[ebp+8h]
		mov dl, byte ptr ds:[edx+ecx]
		mov byte ptr ds:[eax], dl
		mov byte ptr ds:[eax+1], 0h
		cmp dwLength, ecx
		je @OK
		inc eax
		add ecx, 2h
		jmp @LOP
@OK:
		mov eax, g_dwBuffer
@RET:
		mov ecx, nECX
		mov edx, nEDX
		ret
	ARStrWideToAnsi endp

	ARWriteConsoleA proc lpText: DWORD
		call ResetError

		push STD_INPUT_HANDLE
		call GetStdHandle
		mov g_hStdInput, eax

		push STD_ERROR_HANDLE
		call GetStdHandle
		mov g_hStdError, eax

		push STD_OUTPUT_HANDLE
		call GetStdHandle
		mov g_hStdOutput, eax

		push 0h
		lea eax, g_dwReturn
		push eax
		push dword ptr ss:[ebp+8h]
		call lstrlenA
		push eax
		push dword ptr ss:[ebp+8h]
		push g_hStdOutput
		call WriteFile
		ret
	ARWriteConsoleA endp

	ARWriteConsoleW proc lpText: DWORD
		call ResetError

		push STD_INPUT_HANDLE
		call GetStdHandle
		mov g_hStdInput, eax

		push STD_ERROR_HANDLE
		call GetStdHandle
		mov g_hStdError, eax

		push STD_OUTPUT_HANDLE
		call GetStdHandle
		mov g_hStdOutput, eax

		push 0h
		lea eax, g_dwReturn
		push eax
		push dword ptr ss:[ebp+8h]
		call lstrlenW
		push eax
		push dword ptr ss:[ebp+8h]
		push g_hStdOutput
		call WriteFile
		ret
	ARWriteConsoleW endp

	ARWriteFile	proc hFile: DWORD, lpText: DWORD
		local dwReturn: DWORD

		call ResetError

		push 0h
		lea eax, dwReturn
		push eax

		push dword ptr ss:[ebp+0Ch]
		call lstrlenA
		push eax

		push dword ptr ss:[ebp+0Ch]
		push dword ptr ss:[ebp+8h]
		call WriteFile
		ret
	ARWriteFile endp

	ARXORCrypt proc lpText: DWORD, lpPassword: DWORD
		local nECX: DWORD
		local nEDX: DWORD
		local dwESI: DWORD
		local dwTextLength: DWORD
		local dwPassLength: DWORD
		local hHeap: DWORD

		mov nECX, ecx
		mov nEDX, edx
		mov dwESI, esi
		call ResetError

		push dword ptr ss:[ebp+8h]
		call lstrlenA
		mov dwTextLength, eax

		push dword ptr ss:[ebp+0Ch]
		call lstrlenA
		mov dwPassLength, eax

		mov eax, dwTextLength
		cmp eax, 0h
		je @RET

		mov eax, dwPassLength
		cmp eax, 0h
		je @RET

		call GetProcessHeap
		mov hHeap, eax

		push dwTextLength
		push HEAP_ZERO_MEMORY
		push hHeap
		call HeapAlloc
		mov g_dwBuffer, eax

		xor ecx, ecx
		xor edx, edx
@LOP:
		mov eax, dword ptr ss:[ebp+8h]
		mov esi, dword ptr ss:[ebp+0Ch]
		mov ah, byte ptr ds:[eax+ecx]
		mov al, byte ptr ds:[esi+edx]
		xor ah, al
		mov esi, g_dwBuffer
		mov byte ptr ds:[esi+ecx], ah
		mov byte ptr ds:[esi+ecx+1], 0h
		inc ecx
		inc edx
		cmp edx, dwPassLength
		jne @F
		xor edx, edx
@@:
		cmp ecx, dwTextLength
		jne @LOP
		mov eax, g_dwBuffer
@RET:
		mov ecx, nECX
		mov edx, nEDX
		mov esi, dwESI
		ret
	ARXORCrypt endp
